import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import StudentView from '../views/StudentView.vue'
import ScoreView from '../views/ScoreView.vue'
import Home from '../components/Home.vue'
import classRoom from '../components/ClassRoom.vue'
import imgMerge from '@/components/AI/AIGC/ImgMerge.vue'
import imgWriting from '@/components/AI/AIGC/ImgWriting.vue'
import permutation from '@/components/AI/AIGC/Permutation.vue'
import archFoot from '@/components/AI/imgUse/ArchFoot.vue'
import bootTree from '@/components/AI/imgUse/BootTree.vue'
import foot from '@/components/AI/imgUse/Foot.vue'
import inspirationMerge from '@/components/AI/AIGC/InspirationMerge.vue'
import Table from '@/components/Table.vue'
import D from '@/components/D.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),

  routes: [
    {
      path: '/',
      redirect: to => {
        // 方法接收目标路由作为参数
        // return 重定向的字符串路径/路径对象
        return { path: '/home' }
      },
      name: 'home',
      component: HomeView,
      children: [
        {
          path: '/3d',
          name: '3d',
          component: D
        },
        {
          path: '/table',
          name: 'table',
          component: Table
        },
        {
          path: '/home',
          name: 'home',
          component: Home
        },
        {
          path: '/student',
          name: 'student',
          component: StudentView
        },
        {
          path: '/score',
          name: 'score',
          component: ScoreView
        },
        {
          path: '/classRoom',
          name: 'classRoom',
          component: classRoom
        },
        {
          path: '/imgMerge',
          name: 'imgMerge',
          component: imgMerge
        },
        {
          path: '/imgWriting',
          name: 'imgWriting',
          component: imgWriting
        },
        {
          path: '/permutation',
          name: 'permutation',
          component: permutation
        },
        {
          path: '/archFoot',
          name: 'archFoot',
          component: archFoot
        },
        {
          path: '/bootTree',
          name: 'bootTree',
          component: bootTree
        },
        {
          path: '/foot',
          name: 'foot',
          component: foot
        },
        {
          path: '/inspirationMerge',
          name: 'inspirationMerge',
          component: inspirationMerge
        }
      ]
    },

  ]
})

export default router
